 <?php
 require_once('./admin/View/inc_admin.php');
 ?> 
 <div id="content">
  <div class="inner" style="min-height:1200px;">
    <div class="row">
      <div class="col-xs-12">
        <!doctype html>
        <html lang="zh-cn">
        <head>
          <meta charset="UTF-8">  
          <title>用户列表</title>
          <link rel="stylesheet" href="./admin/View/assets/css/bootstrap.min.css">
        </head>
        <body>

         <center><h3>用户列表</h3></center>
         <div class="container-fluid col-md-offset-2 col-md-8">
           <table align="center"  class="table table-striped"> 
             <tr class="success">
               <th>用户编号</th>
               <th>用户名</th>   
               <th>性别</th>
               <th>生日</th>
               <th>爱好</th>
               <th>学历</th>
               <th>自我介绍</th> 
               <th width='80'>头像</th>
               <th>操作 <a href="index.php?c=user&m=userform">添加</a></th>
             </tr>

             <?php
             foreach ($data['users'] as $row) {
              echo '<tr>';
              echo '<td>'.$row['uid'].'</td>';
              echo '<td>'.$row['uname'].'</td>';	 
              echo '<td>'.($row['gender']==0?'男':'女').'</td>';
              echo '<td>'.$row['birthdate'].'</td>';
              echo '<td>'.$row['hobby'].'</td>';
              switch($row['degree']){
                case '1':$dg = "高中";break;
                case '2':$dg = "大学";break;
                case '3':$dg = "研究生";break;
                case '4':$dg = "博士生";break;
                default: $dg="不知道";
              }
              echo '<td>'.$dg.'</td>';
              echo '<td>'.$row['intro'].'</td>';	 	 
              echo '<td align="center"><img src="upload/'.$row['pic'].'" width=60 height=80 alt="无头像"></td>';	 
              echo '<td><a href="index.php?c=user&m=usermod&id='.$row['uid'].' "><button type="button" class="btn btn-default ">修改</button></a>
              <a href="index.php?c=user&m=delete&id='.$row['uid'].'" onClick="return confirm(\'确定要删除吗？\');"><button type="button" class="btn btn-default ">删除</button></a></td>';
              echo '</tr>';  
            }
            echo '</table>';  
            $totalrows = count($data['users']);
            echo "<table align='center'><tr><td>共有{$totalrows}名用户</td></tr></table>";   
            ?>
          </table>
        </div>
      </div>
    </div>
    <hr />
  </div>
  <script src="./admin/View/assets/plugins/jquery-2.0.3.min.js"></script>
  <script src="./admin/View/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
  <script src="./admin/View/assets/plugins/modernizr-2.6.2-respond-1.1.0.min.js"></script>
</body>
</html> 